﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AuthorAttribute
{
    /// <summary>
    /// 用于对类的描述，该特性只能作用于类,该特性是可以多次标注的
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
    public class AuthorAttribute : Attribute
    {
        private string _author;
        private string _dateTime;
        private double _versionCode;
        private string _remark;

        /// <summary>
        /// 建立对类描述的attribute
        /// </summary>
        /// <param name="author">作者</param>
        /// <param name="dateTime">创建时间</param>
        /// <param name="versionCode">版本号</param>
        /// <param name="remark">藐视信息</param>
        public AuthorAttribute(string author, string dateTime, double versionCode, string remark)
        {
            this.Author = author;
            this.DateTime = dateTime;
            this.VersionCode = versionCode;
            this.Remark = remark;
        }

        /// <summary>
        /// 设置或者获取该类的创建人信息
        /// </summary>
        public string Author
        {
            get
            {
                return _author;
            }

            private set
            {
                _author = value;
            }
        }

        /// <summary>
        /// 获取或设置类的创建时间
        /// </summary>
        public string DateTime
        {
            get
            {
                return _dateTime;
            }

            private set
            {
                _dateTime = value;
            }
        }

        /// <summary>
        /// 类的版本号
        /// </summary>
        public double VersionCode
        {
            get
            {
                return _versionCode;
            }

            private set
            {
                _versionCode = value;
            }
        }

        /// <summary>
        /// 获取或设置类的描述信息
        /// </summary>
        public string Remark
        {
            get
            {
                return _remark;
            }

            private set
            {
                _remark = value;
            }
        }
    }
}
